<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 86177
  Date: 2021/11/29
  Time: 23:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>List</title>
</head>
<body>
    <table align="center" border="1">
        <caption>图书馆管理界面</caption>
        <tr>
            <th>书名</th>
            <th>作者</th>
            <th>价格</th>
            <th>出版社</th>
            <th>出版日期</th>
            <th>操作</th>
        </tr>
        <c:forEach var="book" items="${list}" varStatus="st">
            <c:if test="${st.count%2==0}">
                <tr bgcolor="#f0ffff">
            </c:if>
            <c:if test="${st.count%2==1}">
                <tr bgcolor="#f0f8ff">
            </c:if>
                    <td>${book.bookName}</td>
                    <td>${book.author}</td>
                    <td>${book.price}</td>
                    <td>${book.press}</td>
                    <td>${book.pressDate}</td>
                    <td><a href="<%=request.getContextPath()%>/bookstore?act=edit&id=${book.id}" title="编辑">编辑</a></td>
                    <td><a href="<%=request.getContextPath()%>/bookstore?act=delete&id=${book.id}" title="删除">删除</a></td>
                </tr>
        </c:forEach>
        <tr>
            <td><a href="<%=request.getContextPath()%>/bookstore?act=add">新增书籍</a></td>
            <td><a href="<%=request.getContextPath()%>/bookstore?act=exit" title="退出">退出</a></td>
        </tr>
    </table>
</body>
</html>
